<?php
header('Contect-type:text/html; charset="utf8";');
class guest extends ControllerAbstract
{
	public function index()
	{
		htmlHead('Welcome to sysfile ');
		import('guest','index','js');
		import('guest','index','css');
		//var_dump(sina());//获取地理信息调试
		//header("Access-Control-Allow-Origi:*");
		//header("Access-Control-Allow-Origi:http://www.test2.com ");
		$locPrtSys = '';//本地 prt080a 项目扩展
		echo '<meta http-equiv=\'Content-Type\' content=\'text/html; charset=utf-8\' /></head><body>';
		//echo '<meta charset="utf-8"></head><body>';
		echo '<p id="navi"><a href="javascript:void(0);" id="croSys">ConeroSystem</a>';
		$logined = '<a href="guest.php?sid='.crypt('getRight','guest').'" title="文件系统通行证" id="getRightBar">钥匙</a>';
		if(isset($_SESSION['user']) && $_SESSION['user'] != '') {//登入才显示
			echo '<a href="file.php" id="sisFileBar">文件管理系统</a> ';
			$locPrtSys = '
				<li>. <a href="'.APP.'locPrtSys/locPrtSys.php" title="Location Prt080a System Application" class="extendM">locPrtSys</a></li>
				<li>. <a href="'.APP.'WeChat/WeChat.php" title="微信开发平台学习以及应用" class="extendM">WeChat</a></li>
				<li id="loOuM" _u="file.php?sid='.crypt('Close','file').'">. Login Out</li>
			';
			$logined = '';//登入后不再显示
		}
		$dns= '';
		$dns_plus = cro_dns();
		foreach($dns_plus as $k=>$v){

			if(substr_count($v,$_SERVER['SERVER_NAME']) == 0)//过滤当前的地址
				$dns .= '<li onClick="cro_dns(\''.$v.'\')" title="'.$v.'">.'.$k.'</li>';
			else
				$dns .= '<input type="hidden" value="'.$v.'" id="cur_dsn">';
			
			//$dns .= '<li onClick="cro_dns(\''.$v.'\''.((substr_count($v,$_SERVER['SERVER_NAME']) == 0)? '':',\'self\'').')" title="'.$v.'">.'.$k.'</li>';
		}
		echo '
			<a href="index.php?sid='.crypt('Zone','hyang').'" title="全球主要时区展览" id="zoneBar">时区一览</a>
			'.$logined.'
			<a href="'.APP.'learn/learn.php" title="测试前言网页知识" id="learnBar">技术中心</a>
			<a href="index.php?sid='.crypt('test','hyang').'" title="PHP程序代码简洁测试" id="testBar">测试页面</a>
			<a href="guest.php?sid='.crypt('template','guest').'" title="自作模板测试" id="tmpltBar">模板</a>
			<a href="guest.php?sid='.crypt('learn','guest').'" title="学习网站前沿知识参考网站" id="sitesBar">学习网站</a>
			<a href="guest.php?sid='.crypt('phpinfos','guest').'" title="php相关信息" id="pnewsBar">phpinfo</a>
			<a href="'.APP.'PHPStudy/PHPStudy.php" title="编程学习与应用" id="pGitBar">APP</a>
			<a href="javascript:void(0);" onclick="H.camera()" id="cameraBar" title="测试照相机">照相</a>
			<a href="javascript:void(0);"  id="moreBar" >MORE...</a>
			<ul id="menuMore">
				<li style="text-align:center;">更多应用……</li>
				<li id="soLiM">. Software Lists</li>
				<li id="reSyM">. Refresh System</li>
				'.$dns
				.$locPrtSys.'
			</ul>
			</p>
		';
		import('guest','index');
		/*
		use_libs('phpqrcode','qrlib');
		ob_clean();//此语句没有会造成程序错误
		QRcode::png('http://1.1.1.129/_joshua/sysfile/guest.php');
		*/
		echo '</body></html>';
	}
	public function getRight()
	{
		htmlHead('Let me in,right? ');
		import('guest','getRight','js');
		echo '<meta charset="utf-8"></head><body>';
		echo '<p>
			<a href="file.php">文件管理系统</a>
			<a href="guest.php?sid='.crypt("register","guest").'">登记</a>
			<a href="guest.php">Back</a>
			</p>
			
		';
		$_COOKIE['user'] = 'Brximl';
		setcookie("test", '中文Cookie中间件,支持中文，中文扩展',time()+3600);
		echo isset($_COOKIE['jsset'])?   $_COOKIE['jsset'] : '';
		print_r($_COOKIE);
		import('guest','getRight');
		echo '</body></html>';
	}
	public function register()
	{
		htmlHead('register Page');
		import('guest','register','js');
		import('guest','register','css');
		echo UTFHB;
		import('guest','register');
		echo ENDBH;
	}
	public function learn()
	{
		htmlHead('学习网站');
		import('guest','learn','js');
		//import('guest','learn','css');
		echo UTFHB;
		import('guest','learn');
		echo ENDBH;
	}

	public function template()
	{
		header("content-type:text/html; charset=utf-8;");
		$this->pHead("模板测试！");
		$pDance = '<p>应该将模板信息加载到系统中去。完善系统自信息</p>';
		$this->setpParam(array("pDance"=>$pDance ));
		$this->setpAttr(array("pId"=>"template"));
		$this->pageInit();
	}

	public function phpinfos()
	{
		$this->pHead("phpinfos");
		$this->setpParam(array("pDance"=>phpinfo()));
		$this->setpAttr(array("pId"=>"phpinfos"));
		$this->pageInit();
	}
}
?>